package com.vdong.data.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vdong.data.model.enums.Mode;

/**
 * The persistent class for the template_carry_mode database table.
 */
@Entity
@Table(name = "template_carry_mode")
@NamedQuery(name = "TemplateCarryMode.findAll", query = "SELECT t FROM TemplateCarryMode t")
public class TemplateCarryMode implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue
    private int id;

    @Column(name = "actual_amount")
    private BigDecimal actualAmount;

    @Column(name = "min_amount")
    private BigDecimal minAmount;

    private Mode mode;

    @Column(name = "shipper_id")
    private int shipperId;

    @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
    @JoinColumn(name = "template_id")
    @JsonIgnore
    private Template template;
    private String areas;

    public String getAreas() {
        return areas;
    }

    public void setAreas(String areas) {
        this.areas = areas;
    }

    public TemplateCarryMode() {
    }

    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public BigDecimal getActualAmount() {
        return this.actualAmount;
    }

    public void setActualAmount(BigDecimal actualAmount) {
        this.actualAmount = actualAmount;
    }

    public BigDecimal getMinAmount() {
        return this.minAmount;
    }

    public void setMinAmount(BigDecimal minAmount) {
        this.minAmount = minAmount;
    }

    public Mode getMode() {
        return mode;
    }

    public void setMode(Mode mode) {
        this.mode = mode;
    }

    public int getShipperId() {
        return this.shipperId;
    }

    public void setShipperId(int shipperId) {
        this.shipperId = shipperId;
    }

    public Template getTemplate() {
        return template;
    }

    public void setTemplate(Template template) {
        this.template = template;
    }

    @Override
    public String toString() {
        return "TemplateCarryMode [id=" + id + ", actualAmount=" + actualAmount + ", minAmount=" + minAmount + ", mode="
                + mode + ", shipperId=" + shipperId + ", template=" + template + ", areas=" + areas + "]";
    }

}